home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 6 / Amoszine 6 (Disk 1 of 2).adf / arts / Int4.asc.cm / Int4.asc.cm
Encoding:
Text File  |  1992-09-02  |  4.1 KB  |  94 lines

  1. @2                         Understanding the Interface
  2.                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.       @3Part 4 - EDIT ZONES
  4.       ~~~~~~
  5. @4
  6.       So far, you should be getting along quite nicely with the
  7.       basics of the interface.  You should be able to create simple
  8.       requesters, similar to those that are found within AMOS
  9.       Professional itself.  A zone that is used extensively in AMOS
  10.       Pro (and Workbench) is the Edit Zone.  In this type of zone,
  11.       you can enter text or numbers and use the cursor keys,
  12.       perfect for database programs where the user wants to fill in
  13.       fields of information.  
  14.  
  15.       As always, a pre-written program is supplied named
  16.       'Interface_Example6.AMOS'.  Load this into the editor now and
  17.       run it to give you an idea of what it's all about.  3 new
  18.       commands are introduced in this program, all the others you
  19.       should be familiar with.  The first new interface instruction
  20.       is called LIne.  This command will draw a line using the
  21.       graphic image from the resource bank that is specified.  An
  22.       example of its use follows:
  23. @1
  24.       A$=A$+"LIne 8,15,17,240;"
  25. @4
  26.       The first parameter, 8, is the starting X-coordinate of the
  27.       line.  The 15 is the starting Y-coordinate.  The 17 is the
  28.       image in the resource bank for a line (check if you don't
  29.       believe me!) and the 240 is the width of the line.  Easy. 
  30.       All that does is draw a line to put the zone in, just to make
  31.       it look pretty, it doesn't actually set up the zone.  The
  32.       command to set up the zone is described next.  
  33. @1
  34.       A$=A$+"EDit 1,16,19,26,80,'Change me',0,7;"
  35. @4
  36.       That last instruction will set up an edit zone with an
  37.       identification number of 1.  It will be positioned 16 pixels
  38.       across the screen (X-coordinate), and 19 pixels down the
  39.       screen (Y-coordinate).  The maximum amount of characters
  40.       displayed in the zone is 26 although a maximum of 80
  41.       characters is allowed to typed.  After these parameters is
  42.       the initial string which will be put into the zone when the
  43.       edit zone is first drawn.  It can be left blank if you so
  44.       wish.  Next come the paper and pen settings, 0 and 7
  45.       respectively.  Setting up an edit zone is all very well and
  46.       good but so far we have no way of getting the string that was
  47.       entered into the edit zone.  So a function called Rdialog$ is
  48.       supplied which reads strings from a interface program. 
  49. @4
  50.       Rdialog$ is almost the opposite of Vdialog$ which we 
  51.       discussed earlier.  The only difference between the two is
  52.       that Vdialog$ deals with variables and Rdialog$ deals with
  53.       zones.  Rdialog$ is used as follows:
  54. @1
  55.       MESSAGE$=Rdialog$(1,1)
  56. @4
  57.       The two parameters in the Rdialog$ function are the channel
  58.       number and the zone to be read respectively.  The string will
  59.       be passed into the MESSAGE$ variable, so now you can display
  60.       the string using an ordinary Print instruction.  With these
  61.       new instructions, you can build up an edit requester with
  62.       ease.
  63.  
  64.       Another type of edit zone is provided, called a Digit Zone. 
  65.       This just allows the user to enter numbers.  However, this
  66.       type of zone is badly bugged and causes software failures, so
  67.       I don't recommend that you actually use it.  Also, when
  68.       negative numbers are entered, strange results are returned. 
  69.       To see the Digit Zone in action, load the file
  70.       'Interface_Example7.AMOS' into the editor now.  One important
  71.       new instruction in the code is the Rdialog function, which
  72.       like Rdialog$ gets something back from the interface zones. 
  73. @4
  74.  
  75.  
  76.       This version however gets integer values.  Study the code for
  77.       the parameters of both new instructions.
  78.  
  79.  
  80. @5
  81.       Andy will hopefully be back next issue with ven more Interface
  82.       help files and examples for you all.
  83.  
  84.       Why don't you all drop him a line and ask for his help on anything
  85.       to do with the Amos Pro Interface ?
  86.  
  87.       Andy is only too happy to solve your problems via the pages of AZ.
  88.  
  89.  
  90.       His address is elsewhere in this very issue !
  91.  
  92.  
  93.       (Andy Gibson)
  94.